import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	//状态--数据
	state: {
		count: 100,
		audioPlayer: {
			audioId: '488249475',
			audioImg: 'http://p3.music.126.net/lnOnBbP_H-052Hv5ls-QjA==/109951162964628408.jpg',
			audioName: '哪里都是你',
			arName: '队长',
			playFlag: true
		},
		audioId: '488249475'
	},
	//修改state的函数事件
	mutations: {
		changeMusic(state,{audioId,audioImg,audioName,arName}) {
			state.audioPlayer.audioId = audioId
			state.audioPlayer.audioImg = audioImg
			state.audioPlayer.audioName = audioName
			state.audioId = audioId
			state.audioPlayer.arName = arName
		},
		updataIsbtnShow(state,payload) {
			state.audioPlayer.playFlag = payload
		}
	}
})

export default store